#ifndef EYERWASMINDEXEDDB_HPP
#define EYERWASMINDEXEDDB_HPP

#include <string>
#include "EyerWASMCommon/EyerWASMBuffer.hpp"

namespace Eyer
{
    class EyerWASMIndexedDB
    {
    public:
        EyerWASMIndexedDB(const std::string & _dbName);
        ~EyerWASMIndexedDB();

        int Open();
        int Put(const std::string & key,
                const uint8_t * buf,
                size_t bufSize,
                int64_t contentLength,
                int64_t rangeLength);

        int Get(
                const std::string & key,
                EyerWASMBuffer & buffer,
                int64_t * contentLength,
                int64_t * rangeLength
                );
        int Close();
    private:
        std::string dbName = "";

        int indexedDBKey = 0;
    };
}

#endif //EYERWASMINDEXEDDB_HPP
